package com.hai.books.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hai.books.entity.BookInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

@Mapper
public interface BookInfoMapper extends BaseMapper<BookInfo> {


    /**
     * 查询
     * @return
     */
    List<BookInfo> queryBookInfoList(Map<String, Object> map);


    /**
     * 查询总条数
     * @param map
     * @return
     */
    int queryBookIfoCount(Map<String, Object> map);


    @Update("update book_info set isborrowed=1 where bookid=#{bookid}")
    int updateBook(@Param("bookid") int bookid);
}
